package com.xdb.sqlparser.dialect.oracle.ast.expr;

import com.xdb.sqlparser.ast.AbstractSQLExprImpl;
import com.xdb.sqlparser.ast.expr.SQLLiteralExpr;
import com.xdb.sqlparser.dialect.oracle.visitor.OracleASTVisitor;
import com.xdb.sqlparser.visitor.SQLAstVisitor;

public class OracleDateExpr extends AbstractSQLExprImpl implements SQLLiteralExpr, OracleExpr {

	private String literal;

	public OracleDateExpr() {

	}

	public String getLiteral() {
		return literal;
	}

	public void setLiteral(String literal) {
		this.literal = literal;
	}

	@Override
	protected void accept0(SQLAstVisitor visitor) {
		this.accept0((OracleASTVisitor) visitor);
	}

	public void accept0(OracleASTVisitor visitor) {
		visitor.visit(this);
		visitor.endVisit(this);
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((literal == null) ? 0 : literal.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj) {
			return true;
		}
		if (obj == null) {
			return false;
		}
		if (getClass() != obj.getClass()) {
			return false;
		}
		OracleDateExpr other = (OracleDateExpr) obj;
		if (literal == null) {
			if (other.literal != null) {
				return false;
			}
		} else if (!literal.equals(other.literal)) {
			return false;
		}
		return true;
	}

}
